{_obsidian_pattern_tag_public}
now working on rdferry
<streamed-graph expanded="true">
<sg-source url="view1.n3"></sg-source>
<sg-view uri="http://something/in/view1"></sg-view>
<sg-source url="demo1.n3"></sg-source>
<sg-source url="/path/to/demo2/graph"></sg-source>
<sg-source url="/path/to/demo3/graph/events"></sg-source>
</streamed-graph>
This elem can look like nothing (todo), a little summary box, or a big table.
The <streamed-graph>
elem is backed by a single Graph
(read-only) obj that other elems on a page could query or watch for changes.
Each <sg-source>
and <sg-view>
starts another StreamedGraphClient
in the <streamed-graph>
, though this client can reduce to a static file loader (as in view1.n3
and demo1.n3
and demo2/graph
). You can ask the SGC to reload or periodically-reload the graph.
The SGC url
attribute can fetch these content-types:
content-type | reader inside SGClient |
---|---|
application/nquads | SingleN3Reader (N3.js has one reader for all these) |
application/n-triples | SingleN3Reader |
application/trig | SingleN3Reader |
text/n3 | SingleN3Reader |
text/rdf+n3 | SingleN3Reader |
text/turtle | SingleN3Reader |
text/event-stream | EventStreamReader |
Each SGC's reader emits patches to Graph
. Naturally, multiple SGC can provide overlapping quads. Maybe Graph
needs quints: (s, p, o, g, source)
or (s, p, o, g, refcount)
. The SG doesn't own any quads; it just queries over all the SGC graphs.
<streamed-graph>
can subscribe to. Or, if the consumer reloads or queries over the <streamed-graph>
's graph, the statement might appear in there. streamed-graph elem:
graph: N3.Store
addEventListener("patch", cb): get patches (which a caller could just use as a ping to reread the graph)
expanded: bool,
status: string, short summary of connection, errors, etc
Event | Fired by | Listened by | Notes | |
---|---|---|---|---|
sourceGraphChanged | SourceGraph | SgSource | not sent on the destruction of a SourceGraph | |
graphChanged | SgSource | ConfiguredSources | StreamGraph may consolidate change events into fewer events | |
newSourceGraph | SgSource | ConfiguredSources | a previous SourceGraph may have gone away- this should be in the event | |
graphChanged | MultiStore | users | possibly consolidated. And how do you know if the graph changed between these evs? Do we need version clocks? | |
It would be nice to use bnodes or something to connect a layout of widgets to a graph structure that can be repeated. The table view is an example of simple paths turning into RO columns, but suppose you wanted to draw the faders in a submaster.
Given a file like dhcp_hosts.j2, I'd like to parse the lines and make them visible in lanscape. Then watch the file and when it changes, update the graph plus emit some events.
input text:
# kitchen
1c:f2:9a:63:c3:40,set:filtereddns,10.2.0.242,2h
Output n3:
mac:1cf29a64c430 a dhcp:AssignedHost;
dhcp:tag dhcptag:filtereddns;
dhcp:ip "10.2.0.242";
dhcp:lease "2h"^^:duration;
dhcp:fileComment "kitchen".
makepad